package com.woniu.repaircenter.service.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
import com.woniu.repaircenter.models.dto.RepairCategoryDTO;
import com.woniu.repaircenter.service.model.RepairCategory;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 维修类别表 Mapper 接口
 * </p>
 *
 * @author 吕雨泽
 * @since 2024年12月06日
 */
@Mapper
public interface RepairCategoryMapper extends BaseMapper<RepairCategory> {

    RepairCategory selectCategoryName(@Param("categoryName") String categoryName);

    Integer addRepairCategory(RepairCategory category);

    Integer updateCategory(RepairCategory category);

    List<RepairCategoryDTO> selectCategoryList(RepairCategory category);

    @Delete("delete from repair_category where repair_category_id = #{repairCategoryId}")
    Integer deleteCategory(Integer repairCategoryId);
}
